package com.bilicute.libman.service.impl;

import com.bilicute.libman.mapper.BookMapper;
import com.bilicute.libman.mapper.RecordMapper;
import com.bilicute.libman.mapper.UserMapper;
import com.bilicute.libman.service.InfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @所属包名: com.bilicute.libman.service.impl
 * @类名: InfoServiseImpl
 * @作者: i囡漫笔
 * @描述:
 * @创建时间: 2024-06-30 02:34
 */

@Service
public class InfoServiceImpl implements InfoService {
    private UserMapper userMapper;
    @Autowired
    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    private BookMapper bookMapper;
    @Autowired
    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    private RecordMapper recordMapper;
    @Autowired
    public void setRecordMapper(RecordMapper recordMapper) {
        this.recordMapper = recordMapper;
    }

    @Override
    public Map<String, Integer> getAllNum() {
        Map<String,Integer> map = new HashMap<>();
        map.put("userAllNum",userMapper.getAllNum());
        map.put("bookAllNum",bookMapper.getAllNum());
        map.put("recordAllNum",recordMapper.getAllNum());
        return map;
    }
}
